package com.lc.midi.script;



public class Config {
	private int width = 1920;				//分辨率
	private int height = 1080;	
	private boolean touchRecord = false;	//点击录制按钮
	private int waitStartTime = 1000;		//开始等待时间
	private int maxBlankTime = 2000;		//两个相邻音最大时间差
	private String kind = "js";				//脚本类型
	private String imei = null;				//imei
	private String midiName = null;			//文件名
	private String note = "\n"
			+ "/*" + "\n"
			+ "脚本作者QQ：1952511149" + "\n"
			+ "浏览器进 http://49.235.33.223  在线制作脚本（需要费用）" + "\n"
			+ "可定制" + "\n" + "*/" + "\n";	//js内置信息
	private String appVersion = null;		//app版本
	private boolean ts = false;				//播放器版
	private String pianoApp = "明日之后";		//钢琴软件
	public Config() {
	}
	
	@Override
	public String toString() {
		String str = "配置:";
		if (width != 1920 || height != 1080) {
			str += " 分辨率:" + width + "*" + height;
		}
		if (touchRecord) {
			str += " 点击录制按钮";
		}
		if (waitStartTime != 1000) {
			str += " 开始等待时间:" + waitStartTime + "ms";
		}
		str += " 类型：" + kind;
		if (imei == null) {
			str += " 无IMEI";
		}else {
			str += " IMEI:" + imei;
		}
//		str += " 文件名:" + midi.getName();
		if (note == null || note.equals("")) {
			str += " 无js推广信息";
		}
		if (appVersion != null) {
			str += " app版本:" + appVersion;
		}
//		if (midi.getGold() != 0) {
//			str += " mid价格:" + midi.getGold();
//		}
		if (ts) {
			str += " 特定软件版";
		}
		str += " 钢琴软件：" + pianoApp;
		return str;
	}

	public Config(int width, int high) {
		this(width, high, true, 1000);
	}

	public Config(boolean touchRecord) {
		this.touchRecord = touchRecord;
	}

	public Config(int width, int heigth, boolean touchRecord) {
		this(width, heigth, touchRecord, 1000);
	}

	public Config(int width, int heigth, boolean touchRecord, int waitStartTime) {
		this.width = width;
		this.height = heigth;
		this.touchRecord = touchRecord;
		this.waitStartTime = waitStartTime;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public boolean isTouchRecord() {
		return touchRecord;
	}

	public void setTouchRecord(boolean touchRecord) {
		this.touchRecord = touchRecord;
	}

	public int getWaitStartTime() {
		return waitStartTime;
	}

	public void setWaitStartTime(int waitStartTime) {
		this.waitStartTime = waitStartTime;
	}

	public String getKind() {
		return kind;
	}

	public void setKind(String kind) {
		this.kind = kind;
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getFileName() {
		String fileName = midiName;
		if (fileName.contains(".mid")) {
			fileName = fileName.replaceAll(".mid", "");
		}
		if (!fileName.contains(".js") && !fileName.contains(".record")) {
			switch (kind) {
			case "js":
				fileName += ".js";
				break;
			case "leidian":
				fileName += ".record";
				break;
			default:
				break;
			}
		}
		return fileName;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String getAppVersion() {
		return appVersion;
	}

	public void setAppVersion(String appVersion) {
		this.appVersion = appVersion;
	}

	public int getMaxBlankTime() {
		return maxBlankTime;
	}

	public void setMaxBlankTime(int maxBlankTime) {
		this.maxBlankTime = maxBlankTime;
	}


	public boolean isTs() {
		return ts;
	}

	public void setTs(boolean ts) {
		this.ts = ts;
	}

	public String getPianoApp() {
		return pianoApp;
	}

	public void setPianoApp(String pianoApp) {
		this.pianoApp = pianoApp;
	}

}
